class Solution {
    public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
        ListNode cur1 = headA;
        ListNode cur2 = headB;
        while (cur1 != cur2) { // 相遇 、 或者都走过一遍了，没有相遇
            if (cur1 != null) cur1 = cur1.next;
            else cur1 = headB;
            if (cur2 != null) cur2 = cur2.next;
            else cur2 = headA;
        }
        return cur1;
    }
}
// a  c
// b  c
// a + c + b == b + c + a
// c = 0  a + b == b + a 双方都把对方的路给走了一遍没有相遇  cur1 = cur2 = null